import request from "@/utils/request";

export function newarticle(data) {
  console.log(data);
  return request({
    url: "/article/newarticle",
    method: "post",
    data,
    headers: {
      "Content-Type": "multipart/form-data",
    },
  });
}

export function getList(data) {
  return request({
    url: "/article/getList",
    method: "post",
    data,
  });
}

export function doDelete(data) {
  return request({
    url: "/article/deletearticle",
    method: "post",
    data,
  });
}

export function seearticle(data) {
  return request({
    url: "/article/showarticle",
    method: "post",
    data,
  });
}
export function getcommentById(data) {
  return request({
    url: "/comment/getList",
    method: "post",
    data,
  });
}
export function getcommentAll(data) {
  return request({
    url: "/comment/getListAll",
    method: "post",
    data,
  });
}
export function getuserAll(data) {
  return request({
    url: "/user/getList",
    method: "post",
    data,
  });
}
export function editArticle(data) {
  return request({
    url: "/article/modify",
    method: "post",
    data,
    headers: {
      "Content-Type": "multipart/form-data",
    },
  });
}
export function delcomment(data) {
  return request({
    url: "/comment/delete",
    method: "post",
    data,
  });
}
export function deluser(data) {
  return request({
    url: "/user/delete",
    method: "post",
    data,
  });
}
export function getcreatedlist(data) {
  return request({
    url: "/apply/getList",
    method: "post",
    data,
  });
}
export function getcreatedpass(data) {
  return request({
    url: "/apply/accept",
    method: "post",
    data,
  });
}

export function getcreatedrefuse(data) {
  return request({
    url: "/apply/refuse",
    method: "post",
    data,
  });
}
export function getcreatedblock(data) {
  return request({
    url: "/user/block",
    method: "post",
    data,
  });
}
export function getcreatedUnblock(data) {
  return request({
    url: "/user/unblock",
    method: "post",
    data,
  });
}

export function getcreatedremoveRoot(data) {
  return request({
    url: "/user/removeRoot",
    method: "post",
    data,
  });
}
export function getMain(data) {
  return request({
    url: "/",
    method: "post",
    data,
  });
}
